import fetch from '@/utils/network/fetch'

const getBusinessById = (id, objc) => {
    id &&
        fetch(`/api/business_template/${id}`, {
            ...objc
        })
}

const getBusinesses = (data, objc) => {
    data &&
        fetch('/api/business_template', {
            ...objc,
            method: 'post',
            data
        })
}

const saveBusiness = (data, objc) => {
    data &&
        fetch('/api/business_template', {
            ...objc,
            method: 'put',
            data
        })
}

const removeBusinesses = (lIds, objc) => {
    lIds &&
        fetch('/api/business_template/deletion', {
            ...objc,
            method: 'post',
            data: { lIds }
        })
}

export default {
    // Business
    getBusinessById,
    getBusinesses,
    saveBusiness,
    removeBusinesses
}
